package com.pfzy.ui.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.google.android.material.snackbar.Snackbar;
import com.pfzy.ui.R;
import com.pfzy.ui.databinding.ActivitySwitchBinding;

public class SwitchActivity extends AppCompatActivity implements View.OnClickListener {
    private ActivitySwitchBinding mBind;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mBind = ActivitySwitchBinding.inflate(getLayoutInflater());
        setContentView(mBind.getRoot());
        initView();
    }

    private void initView() {
        TextView title = mBind.toolbar.findViewById(R.id.layout_toolbar_title);
        title.setText("吐司");
        mBind.toolbar.findViewById(R.id.layout_toolbar_back).setOnClickListener(this);
        mBind.switchView1.setOpenState(false);
        mBind.switchView2.setOpenState(true);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.layout_toolbar_back:
                finish();
                break;
            default:
                break;
        }
    }
}
